﻿using System;
using System.Globalization;
using System.Windows.Data;
using Labthink.PCSoft.UniversalHost4.Model.DataManage;

namespace Labthink.PCSoft.UniversalHost4.Converters
{
    public class UpdateByOperateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is DataManageRecord record)
            {
                return record.OperateType > 1 && record.OperateResult < -1;
            }

            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
